<template>
  <el-button v-bind="$attrs" v-on="$listeners" v-if="showButton">
    <slot></slot>
  </el-button>
</template>
<script>
export default {
  name: 'newButton',
  props: {
    authCode: {
      type: String
    }
  },
  data() {
    return {
      showButton: false
    }
  },
  mounted() {
    const userData = this.$sessionStorage('userData')
    const authLists = userData ? userData.btnList : ''
    this.showButton = !this.authCode || (authLists && authLists.includes(this.authCode))
  }
}
</script>
